<?php

$url = $this->context->id . '/' . $this->context->action->id;
?>
<?= \common\widgets\Asset::widget(['type'=>['summernote']])?>
    <div class="ui-layout-center ui-layout-pane">
        <div class="container-div">
            <div class="row">
                <div class="col-sm-12 search-collapse" style="display: block">
                    <div class="layui-card-body">
                        <div class="layui-collapse like-layui-collapse" lay-accordion=""
                             style="border:1px dashed #c4c4c4">
                            <div class="layui-colla-item">
                                <h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示<i
                                        class="layui-icon layui-colla-icon"></i></h2>
                                <div class="layui-colla-content layui-show">
                                    <p>*具体请仔细看配置说明；</p>
                                    <p>*分销金额=商品数量*批发价；</p>
                                </div>
                            </div>
                        </div>
                    </div>
                    <form class="form-horizontal" id="form-config-site-site">
                        <div class="form-group">
                            <label class="col-sm-2 control-label is-required">提现手续费：</label>
                            <div class="col-sm-9">
                                <input type="text" name="dis_withdraw_fee" style="width: 50%;display: inline" value="<?= $model->dis_withdraw_fee ?>" class="form-control"
                                       autocomplete="off" required>&emsp;%
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 如果提现手续费设置为3%，手续费=提现金额*3/100，没有手续费</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">一级分销比例：</label>
                            <div class="col-sm-9">
                                <input type="text" name="top_level" value="<?= $model->top_level ?>"
                                       class="form-control" autocomplete="off" style="width: 50%;display: inline">&emsp;%
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 下单用户上上上级分销比例，如:比例设置为20%，金额是100，那么佣金=20*100/100</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">二级分销比例：</label>
                            <div class="col-sm-9">
                                <input type="text" name="one_level" value="<?= $model->one_level ?>"
                                       class="form-control" autocomplete="off" style="width: 50%;display: inline">&emsp;%
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 下单用户上上级分销比例，如:比例设置为20%，金额是100，那么佣金=20*100/100</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">三级分销比例：</label>
                            <div class="col-sm-9">
                                <input type="text" name="second_level" value="<?= $model->second_level ?>"
                                       class="form-control" autocomplete="off" style="width: 50%;display: inline">&emsp;%
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 下单用户上级分销比例，如:比例设置为20%，金额是100，那么佣金=20*100/100</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label is-required">分销申请审核：</label>
                            <div class="col-sm-9">
                                <?= \common\widgets\FormInput::widget(['name'=>'radio','extend'=>['value'=>$model->dis_review,'name'=>'dis_review','required'=>1,'data'=>['关闭','开启'],'tips'=>'开启后，提交分销申请或修改分销信息将进行审核']])?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label is-required">分销协议：</label>
                            <div class="col-sm-9">
                                <?= \common\widgets\FormInput::widget(['name' => 'textarea', 'extend' => ['height' => '500', 'name' => 'dis_agreement', 'class' => 'dis_agreement hide', 'info' => $model]]) ?>
                                <div class="dis_agreement_summernote summernote" data-place=""><?=$model->dis_agreement?></div>
                            </div>
                        </div>
                        <div class="form-group text-center mt20">
                            <a href="javascript:;" class="btn btn-success btn-mid b5submit_btn"
                               data-target="form-config-site-site" data-title="确定提交信息设置"
                               data-url="<?= \yii\helpers\Url::to(['system/tran']) ?>">保存</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
<?php $this->beginBlock('script'); ?>
    <script>
        function b5submit_btn_before() {
            var sHTML1 = $('.dis_agreement_summernote').summernote('code');
            $(".dis_agreement").val(sHTML1);
            return true;
        }
    </script>
<?php $this->endBlock(); ?>